<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>社会关系/家庭成员</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
        <form id="cust_cst_np_social_rl_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">关系</div>
                    <div class="field">
                        <span id="rlTypCdNm" name="rlTypCdNm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">姓名</div>
                    <div class="field">
                        <span id="rlNm" name="rlNm">&nbsp;</span>
                    </div>
                </div>
                 <div class="fieldBox col_50">
			             <div class="label">性别</div>
			             <div class="field">
			              	<span id="genderCd" name="genderCd">&nbsp;</span>
			              </div>
			     </div>
                <div class="fieldBox col_50">
                    <div class="label">手机号</div>
                    <div class="field">
                        <span id="mp" name="mp">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">工作单位</div>
                    <div class="field">
                        <span id="workPlc" name="workPlc">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">职务</div>
                    <div class="field">
                    	<span id="pos" name="pos">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">单位电话</div>
                    <div class="field">
                        <span id="tel" name="tel">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
			        <div class="label">证件类型</div>
			          <div class="field">
			             <span id="certTypCdNm" name="certTypCdNm">&nbsp;</span>
			         </div>
			       </div>
                <div class="fieldBox col_50">
                    <div class="label">证件号</div>
                    <div class="field">
                        <span id="certNo" name="certNo">&nbsp;</span>
                    </div>
                </div>
                 <div class="fieldBox col_50">
                    <div class="label">通讯地址邮编</div>
                    <div class="field">
                        <span id="zipNo" name="zipNo">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">是否实际还款人</div>
                    <div class="field">
                        <span id="isActualPayerNm" name="isActualPayerNm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">民族</div>
                    <div class="field">
                        <span id="nationNm" name="nationNm"></span>
                    </div>
                </div>

                 <div class="fieldBox col_100">
                    <div class="label">身份证地址</div>
                    <div class="field">
                    	<span id="idAddr" name="idAddr">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">现居住地</div>
                    <div class="field">
                         <span id="homeAddr" name="homeAddr">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">单位地址</div>
                    <div class="field">
                         <span id="workAddr" name="workAddr">&nbsp;</span>
                    </div>
                </div>
                 <div class="fieldBox col_100">
                    <div class="label">通讯地址</div>
                    <div class="field">
                     	<span id="postAddr" name="workAddr">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field">
                    	<span id="rlRem" name="rlRem">&nbsp;</span>
                    </div>
                </div>
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name=rId id="rId" type="text" class="ui-textbox" value="${rId}">
		          </div>
		        </div>
            </div>
        </form>
	<script>
		$(function() {
		   $("#cust_cst_np_social_rl_form").ligerForm({
                validate: true
           });
		
	        initData();
		});
		
		//父级窗口会调用取消
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}
		
		function initData(){
			var rId = $("#rId").val();
	    	if(!rId)return;
	    	var wait_dialog= $.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });
	    	var _url = '<%=path%>/customer/cstnpsocialrl/getById.do?isEncrypt=1';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:rId},
	    		url: _url,
	    		success:function(msg){
	    			wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 ligerDialogSuc(msg.info, 3000);
	    			 }
	    		}
	    	});
    	}
		
		//设置页面数据
	    function setData(data){
	    	$("#rlTypCdNm").html(data.rlTypCdNm);
	    	$("#rlNm").html(data.rlNm);
	    	$("#workPlc").html(data.workPlc);
	    	$("#pos").html(data.pos);
	    	$("#mp").html(data.mp);
	    	$("#tel").html(data.tel);
	    	$("#certTypCdNm").html(data.certTypCdNm);
	    	$("#certNo").html(data.certNo);
	    	$("#homeAddr").html(data.homeAddr);
	    	$("#workAddr").html(data.workAddr);
	    	$("#zipNo").html(data.zipNo);
	    	$("#idAddr").html(data.idAddr);
	    	$("#postAddr").html(data.postAddr);
	    	$("#rlRem").html(data.rlRem);
	    	$("#genderCd").html(data.genderCdNm);
	    	$("#isActualPayerNm").html(data.isActualPayerNm);
	    	$("#nationNm").html(data.nationNm);
		};
	</script>
</body>
</html>